#include "Light.h"

Light::Light(int id, int targetId)
{
	position.Set(0, 0, 0);
	roll = 0.0f;

	this ->id = id;
	this ->target = new LightTarget(targetId);
}

Light::~Light()
{
	if (target != NULL)
		delete target;
}

void Light::Process(float ms)
{
}

sm::Vec3 Light::GetPosition()
{
	return position;
}

sm::Vec3 Light::GetTargetPosition()
{
	return target ->GetPosition();
}

float Light::GetRoll()
{
	return roll;
}

float Light::GetTargetDistance()
{
	sm::Vec3 camTarget = target ->GetPosition();
	sm::Vec3 v = camTarget - position;
	return v.GetLength();
}

void Light::SetPosition(sm::Vec3 position)
{
	this ->position = position;
}

void Light::SetLookTarget(sm::Vec3 lookTarget)
{
	this ->target ->SetPosition(lookTarget);
}

void Light::SetRoll(float roll)
{
	this ->roll = roll;
}

void Light::SetRotation(float angle, sm::Vec3 axis)
{
}

void Light::SetScale(sm::Vec3 scale)
{
}

int Light::GetId()
{
	return id;
}

LightTarget * Light::GetTarget()
{
	return target;
}